<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<link rel="stylesheet" href="css/amazeui.min.css" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/css/amazeui.min.css" type="text/css" />
		<link rel="stylesheet" href="css/style.css" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/css/style.css" type="text/css" />
		<link rel="stylesheet" href="layui/css/layui.css"  media="all">
	</head>
	<body >
    <header data-am-widget="header" class="am-header am-header-default jz">
      <div class="am-header-left am-header-nav">
         <a href="javascript:history.back()" class="">
			<i class="am-icon-chevron-left"></i>
		</a>
      </div>
      <h1 class="am-header-title">
          <a href="#title-link" class="">业主圈</a>
      </h1>
      <div class="am-header-right am-header-nav">
         <a id="saves" class="">
			发布
		</a>
      </div>
    </header>
    <div style="margin-left: 15px;margin-top: 20px;" class="doc-example">
		<span class="am-icon-spinner am-icon-sm" style="color: #C10802;"></span>
		<span style="font-family: '微软雅黑';font-weight: 800;">业主发言区</span>
	</div>
	<div class="reg2">
	    <textarea class="ts" placeholder="请输入内容"></textarea>
		<!--<button class="login-btn" id="saves" type="button">提交</button>-->
	</div>
    <div style="height: 52px;"></div>
	<div data-am-widget="navbar" class="am-navbar  gm-foot am-no-layout" id="">
		<ul class="am-navbar-nav am-cf am-avg-sm-4">
			<li>
				<a href="index.html" class="curr">
					<span class="am-icon-home"></span>
					<span class="am-navbar-label">首页</span>
				</a>
			</li>
			<li>
				<a href="price.html" class="">
					<span class="am-icon-paypal"></span>
					<span class="am-navbar-label">报价</span>
				</a>
			</li>
			<li class="curr">
				<a href="yezhuquan.html" class="">
					<span class="am-icon-spinner"></span>
					<span class="am-navbar-label">业主圈</span>
				</a>
			</li>
			<li>
				<a href="main.html" class="">
					<span class="am-icon-user"></span>
					<span class="am-navbar-label">我的</span>
				</a>
			</li>
		</ul>
	</div>
	</body>
	<script type="text/javascript" src="js/jquery.min.js" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/js/jquery.min.js" ></script>
	<script type="text/javascript" src="js/amazeui.min.js" tppabs="http://yanshi.sucaihuo.com/modals/16/1608/demo/js/amazeui.min.js"></script>
	<script type="text/javascript" src="js/hui.js"></script>
	<script>
		var id = localStorage.getItem("id");
		if(!id){
			location.href="login.html";
		}
		$("#saves").click(function(){
			var contents = $(".ts").val();
          	if(!contents){
               hui.toast('内容不能为空!', 1000);
              return;
            }
			hui.postJSON(
			    rootpath+'/char/charAddSave/',
			    {
			    	content:contents,
			    	businessManId: id
			    },
			    function(msg){
			    	if(msg.result=="false"){
			    		hui.toast("发布失败!", 1000);
			    	}else{
			    		hui.toast("发布成功!", 1000);
			    	}
			    	$(".ts").val("");
			    	location.href="yezhuquan.html";
			    },
			    function(e){
			        hui.iconToast('读取消息失败', 'warn');
			        console.log(e);
			    }
			);
		});
	</script>
</html>
